package com.mcgrady.start;

import org.junit.Test;

/**
 * @author McGrady
 */
public class PrintTest {
    @Test
    public void println() {
        System.out.println("1");
        System.out.print("\n\n");
        System.out.print("2");
        System.out.println("3");
    }

    @Test
    public void printf() {
        System.out.printf("%s %d %.2f", "硬盘", 10, 2.587);
    }

    @Test
    public void number(){
        System.out.println(1+2+3+4+5+6);
        System.out.println(1+2+3+"4"+5+6);
        System.out.println("1"+2+3+4+5+6);
    }

    @Test
    public void specialCharacter(){
        System.out.println("1111\n2222");
        System.out.println("3333\t4444");
    }

    @Test
    public void escape(){
        System.out.println("1111\\n2222");
        System.out.println("1111\\t2222");
        System.out.println("1111\\2222");
        System.out.println("\"");
    }
}
